﻿


/*========================================================================================
//Goodasong -- MySnake
//创建者: 郑雪松
//创建时间：2013年2月28日
//类描述：实体类 Mdlist (属性说明自动提取数据库字段的描述信息)
//最后修改者:郑雪松
//最后修改时间:2013年2月28日	
=========================================================================================*/
using System;
using System.Web;
using System.Runtime.Serialization;

namespace COM.PreAlarm.Model
{
    /// <summary>
    /// 实体类 Mdlist (属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]	  
    [Model(Name = "Mdlist", PrimaryKey = "id", ModelType = ModelType.Table, Condition = "1=1", IsNeedRecordModify = true)]
    public partial class MdlistInfo : BaseModel
    {
        public MdlistInfo()
        {            
            PrimaryKey = "id"; 
			Fields.Add("Id");//id
			Fields.Add("Type");//type
			Fields.Add("Text");//text
			Fields.Add("Value");//value
			Fields.Add("Remark");//remark
			Fields.Add("Orderby");//orderby
			Fields.Add("Lasteditby");//lasteditby
			Fields.Add("Lasteditdate");//lasteditdate
			Fields.Add("IsValid");//IsValid
			
			
			this.OnCreated();			
			this.OnModelCreated();
        }
		public MdlistInfo(bool isNewInfo):this()
        {
			IsNew = isNewInfo;
		}
		#region 方法

        public void OnCreated() { this.SetPrimaryKeyValue(); }		

		public override void SetPrimaryKeyValue()
        {
			
        }
        #endregion 
		
		#region 成员变量
				
		private int _Id;//id
		private string _Type;//type
		private string _Text;//text
		private string _Value;//value
		private string _Remark;//remark
		private int _Orderby;//orderby
		private string _Lasteditby;//lasteditby
		private DateTime _Lasteditdate;//lasteditdate
		private bool _IsValid;//IsValid
		
		#endregion
		
		#region 属性 
		
		/// <summary>
        /// id
        /// </summary>       
		[ModelField(Description = "id", Type = typeof(int), ErrorMessage = "id信息错误!", FieldType = FieldType.Normal, IsKeyField = true,IsUnique = true, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 4,  DbType = "int", IsNeedRecordModify = true)]
        public virtual int Id
        {
            get
            {
                return this._Id;
            }
            set
            {
				_Id = value;
            }
        }
		
		/// <summary>
        /// type
        /// </summary>       
		[ModelField(Description = "type", Type = typeof(string), ErrorMessage = "type信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 50,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Type
        {
            get
            {
                return this._Type;
            }
            set
            {
                if (_Type != value || (_Type == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Mdlist", "Type", _Type, value, "varchar", "type");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnTypeChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Type = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnTypeChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Type = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// text
        /// </summary>       
		[ModelField(Description = "text", Type = typeof(string), ErrorMessage = "text信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 50,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Text
        {
            get
            {
                return this._Text;
            }
            set
            {
                if (_Text != value || (_Text == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Mdlist", "Text", _Text, value, "varchar", "text");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnTextChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Text = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnTextChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Text = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// value
        /// </summary>       
		[ModelField(Description = "value", Type = typeof(string), ErrorMessage = "value信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 50,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Value
        {
            get
            {
                return this._Value;
            }
            set
            {
                if (_Value != value || (_Value == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Mdlist", "Value", _Value, value, "varchar", "value");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnValueChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Value = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnValueChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Value = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// remark
        /// </summary>       
		[ModelField(Description = "remark", Type = typeof(string), ErrorMessage = "remark信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 50,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Remark
        {
            get
            {
                return this._Remark;
            }
            set
            {
                if (_Remark != value || (_Remark == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Mdlist", "Remark", _Remark, value, "varchar", "remark");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnRemarkChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Remark = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnRemarkChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Remark = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// orderby
        /// </summary>       
		[ModelField(Description = "orderby", Type = typeof(int), ErrorMessage = "orderby信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 4,  DbType = "int", IsNeedRecordModify = true)]
        public virtual int Orderby
        {
            get
            {
                return this._Orderby;
            }
            set
            {
                if (_Orderby != value || (_Orderby == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Mdlist", "Orderby", _Orderby, value, "int", "orderby");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnOrderbyChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Orderby = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnOrderbyChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Orderby = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// lasteditby
        /// </summary>       
		[ModelField(Description = "lasteditby", Type = typeof(string), ErrorMessage = "lasteditby信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 50,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Lasteditby
        {
            get
            {
                return this._Lasteditby;
            }
            set
            {
                if (_Lasteditby != value || (_Lasteditby == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Mdlist", "Lasteditby", _Lasteditby, value, "varchar", "lasteditby");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnLasteditbyChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Lasteditby = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnLasteditbyChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Lasteditby = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// lasteditdate
        /// </summary>       
		[ModelField(Description = "lasteditdate", Type = typeof(DateTime), ErrorMessage = "lasteditdate信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 8,  DbType = "datetime", IsNeedRecordModify = true)]
        public virtual DateTime Lasteditdate
        {
            get
            {
                return this._Lasteditdate;
            }
            set
            {
                if (_Lasteditdate != value || (_Lasteditdate == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Mdlist", "Lasteditdate", _Lasteditdate, value, "datetime", "lasteditdate");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnLasteditdateChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Lasteditdate = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnLasteditdateChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Lasteditdate = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// IsValid
        /// </summary>       
		[ModelField(Description = "IsValid", Type = typeof(bool), ErrorMessage = "IsValid信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 1,  DbType = "bit", IsNeedRecordModify = true)]
        public virtual bool IsValid
        {
            get
            {
                return this._IsValid;
            }
            set
            {
                if (_IsValid != value || (_IsValid == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("Mdlist", "IsValid", _IsValid, value, "bit", "IsValid");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnIsValidChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._IsValid = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnIsValidChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _IsValid = value;
                    }
                }
            }
        }
		#endregion 属性
				  
		#region 属性更改事件
		
		partial void OnIdChanging(ModifyInfo modifyInfo);//idId改变之前发生
        partial void OnIdChanged(ModifyInfo modifyInfo);//idId改变之后发生
		partial void OnTypeChanging(ModifyInfo modifyInfo);//typeType改变之前发生
        partial void OnTypeChanged(ModifyInfo modifyInfo);//typeType改变之后发生
		partial void OnTextChanging(ModifyInfo modifyInfo);//textText改变之前发生
        partial void OnTextChanged(ModifyInfo modifyInfo);//textText改变之后发生
		partial void OnValueChanging(ModifyInfo modifyInfo);//valueValue改变之前发生
        partial void OnValueChanged(ModifyInfo modifyInfo);//valueValue改变之后发生
		partial void OnRemarkChanging(ModifyInfo modifyInfo);//remarkRemark改变之前发生
        partial void OnRemarkChanged(ModifyInfo modifyInfo);//remarkRemark改变之后发生
		partial void OnOrderbyChanging(ModifyInfo modifyInfo);//orderbyOrderby改变之前发生
        partial void OnOrderbyChanged(ModifyInfo modifyInfo);//orderbyOrderby改变之后发生
		partial void OnLasteditbyChanging(ModifyInfo modifyInfo);//lasteditbyLasteditby改变之前发生
        partial void OnLasteditbyChanged(ModifyInfo modifyInfo);//lasteditbyLasteditby改变之后发生
		partial void OnLasteditdateChanging(ModifyInfo modifyInfo);//lasteditdateLasteditdate改变之前发生
        partial void OnLasteditdateChanged(ModifyInfo modifyInfo);//lasteditdateLasteditdate改变之后发生
		partial void OnIsValidChanging(ModifyInfo modifyInfo);//IsValidIsValid改变之前发生
        partial void OnIsValidChanged(ModifyInfo modifyInfo);//IsValidIsValid改变之后发生
		
		#endregion		
		public virtual string DetailURI { get; set; }
        public virtual string DetailHTMLURI { get; set; }
		public virtual string ManageEditURI {get; set;}
		public virtual string ManageDetailURI {get; set;}
		public override void OnLoaded()
        {
            base.OnLoaded();	
			DetailURI = ZModel.InitDetailURI("Mdlist", "Id", Id);
            DetailHTMLURI = ZModel.InitDetailHTMLURI("Mdlist", "Id", Id);		
			ManageEditURI = ZModel.InitMEditURI("Mdlist", "Id", Id);	
		 	ManageDetailURI = ZModel.InitMDetailURI("Mdlist", "Id", Id);	
			OnModelLoaded();
        }
		
		partial void OnModelCreated();
        partial void OnModelLoaded();
	}	
}